<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>价格详情</title>
</head>
<body>
	<div layout:fragment="content">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 xol-xs-12">
				<div class="table-responsive">
					<div class="panel panel-success">
						<div class="panel-heading">
							<span th:text="'价格表 ' + ${priceHeader.name} + ' 明细'"></span>
							<div class="btn-toolbar pull-right hidden-print">
								<div class="btn-group btn-group-xs">
									<a class="btn btn-default" th:href="@{/prices}">返回列表</a>
								</div>
							</div>
						</div>
						<table class='table table-striped table-hover table-condensed'>
							<thead>
								<tr>
									<th>产品型号</th>
									<th>型号描述</th>
									<th>最小采购量</th>
									<th>最大采购量(含)</th>
									<th>单位</th>
									<th>单价</th>
									<th>币别</th>
									<th>生效日期</th>
									<th>终止日期</th>
								</tr>
							</thead>
							<tbody>
								<tr th:each="line: ${lines}" th:object="${line}">
									<td th:text="*{inventoryModel.modelName}">model_name</td>
									<td th:utext="*{inventoryModel.modelDescription}">model_desc</td>
									<td class="number small-bold-red text-right"
										th:text="*{minOrderQuantity} != -222 ? *{minOrderQuantity} : ''"></td>
									<td class="number small-bold-red text-right"
										th:text="*{maxOrderQuantity} != -222 ? *{maxOrderQuantity} : ''"></td>
									<td th:text="*{uom}"></td>
									<td class="number small-bold-red text-right"
										th:text="*{#numbers.formatDecimal(unitPrice,0,2)}"></td>
									<td th:text="${priceHeader.currency}"></td>
									<td th:text="*{#dates.format(startDate, 'yyyy-MM-dd')}">start_date_active</td>
									<td><span th:if="*{endDate}"
										th:text="*{#dates.format(endDate, 'yyyy-MM-dd')}"></span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>

		<shiro:hasAnyRoles name="系统管理员,客服代表">
			<div class="row">
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
					<div class="panel panel-success">
						<div class="panel-heading">适用客户</div>
						<div th:unless="${#lists.isEmpty(customers)}"
							th:replace="customer/index::showCustomers(${customers})"></div>
						<p class="text-center text-warning"
							style="padding-top: 1rem; padding-bottom: 2rem;"
							th:if="${#lists.isEmpty(customers)}">哇喔〜〜〜，目前此价格表还没分配给任何客户。</p>
					</div>
				</div>
			</div>
		</shiro:hasAnyRoles>
	</div>
</body>
</html>
